package com.tzx.majj.tm.redis;

import java.io.UnsupportedEncodingException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import redis.clients.jedis.JedisPubSub;

/**
 * @author majinding888@foxmail.com
 * @date 2016-7-13 下午1:27:24
 */
public class Subscriber extends JedisPubSub {
	private static Logger logger = LoggerFactory.getLogger(Subscriber.class);

	@Override
	public void onMessage(String channel, String message) {
		logger.info("有消息接收： \nChannel: {}, Msg: {}", channel, message);
	}

	@Override
	public void onPMessage(String pattern, String channel, String message) {

	}

	@Override
	public void onSubscribe(String channel, int subscribedChannels) {
		logger.info("有人订阅消息:\n {}, Msg: {}", channel, subscribedChannels);
	}

	@Override
	public void onUnsubscribe(String channel, int subscribedChannels) {
		logger.info("有人退订订阅消息:\n {}, Msg: {}", channel, subscribedChannels);
	}

	@Override
	public void onPUnsubscribe(String pattern, int subscribedChannels) {

	}

	@Override
	public void onPSubscribe(String pattern, int subscribedChannels) {

	}
}
